<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Map</title>
</head>
<body>
    <script>
        let m = new Map();

        let m1 = new Map([
            ['name','yuonly'],
            ['age',18],
            ['sex','男']
        ]);
        
        // size    返回Map的元素个数
        console.log(m1.size);
        // set     增加一个新元素，返回当前Map
        m1.set('city','beijing');
        // get     返回键名对象的键值
        console.log(m1.get('age'));
        // has     检测Map中是否包含某个元素，返回boolean值
        console.log(m1.has('name1111'));
        // delete 函数对应key
        m1.delete('name');
        // clear   清空集合，返回undefined
        // m1.clear();
        console.log(m1);

        for(let v of m1){
            console.log(v);
        }

    </script>
</body>
</html>